/**
 * 
 */
package metalink.admin;

import java.util.ArrayList;

import model.admin.LibraryMo;

import vo.LibraryBookDetailsVo;

import com.opensymphony.xwork2.ActionSupport;

/**
 * @author Sony
 * 
 */
public class EditBookCategory extends ActionSupport {
	ArrayList<LibraryBookDetailsVo> categories;
	String category="",oldcategory="";
	public String execute() {
		LibraryMo mo=new LibraryMo();
		categories=mo.getCategories();
		System.out.println("came to edit category "+category+" : "+category);
		if(!oldcategory.equals("")&&!category.equals(""))
		{
			System.out.println("came to edit category "+category+" : "+category);
			mo.updateCategory(oldcategory,category,"Updatecategory");
			return "edited";
		}
		
		return SUCCESS;
	}
	public String getOldcategory() {
		return oldcategory;
	}
	public void setOldcategory(String oldcategory) {
		this.oldcategory = oldcategory;
	}
	public ArrayList<LibraryBookDetailsVo> getCategories() {
		return categories;
	}
	public void setCategories(ArrayList<LibraryBookDetailsVo> categories) {
		this.categories = categories;
	}
	public String getCategory() {
		return category;
	}
	public void setCategory(String category) {
		this.category = category;
	}

}
